General examples updates#7727
Conversation
|
@martinius96 Could you please help me out with description on your example |
|
|
||
| #ifndef USE_NAME | ||
| #define USE_MAC | ||
| #endif |
There was a problem hiding this comment.
Since you either have USE_NAME defined, or not, I suggest removing this and using #ifdef+#else in the code below. Else it looks like you could have both defined at the same time.
| public: | ||
| Button(uint8_t reqPin) : PIN(reqPin){ | ||
| pinMode(PIN, INPUT_PULLUP); | ||
| attachInterrupt(PIN, std::bind(&Button::isr,this), FALLING); |
There was a problem hiding this comment.
While your changes provide simpler code, the original example shows how to attach an interrupt to a class method (and that is often asked), so I suggest to keep the old way and use class instead of struct
There was a problem hiding this comment.
@pedrominatel could you please explain why we went from c++ to c?
There was a problem hiding this comment.
It was just a matter of getting consistency across many examples in C, and not in C++.
I would prefer to keep the FunctionalInterrupt example as is and add a new one using a simpler code, as you already did.
There was a problem hiding this comment.
So we agree that the example with class Button should stay and a new one with struct Button should be added?
|
left some notes, otherwise LGTM |
pedrominatel
left a comment
There was a problem hiding this comment.
I've left some minor comments (nitpicking), otherwise, LGTM.
…ion as new example
|
@me-no-dev It's ready to be reviewed and merged. |
* Remove inline code comments for the struct description * Renamed ESPNow examples * Changed example from C++ class to C struct * Updated MultiHomedServers * Updated BT Serial examples * Added short overview of exaples - missing Enterprise * Added draft of Enterprise header note * Fixed note in README * Fixed compilation error * Changed FunctionalInterrupt example * Fixes * Returned FunctionalInterrupts to original state + added modified version as new example Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com>
* Tasmota changes * Tasmota 2.0.6 with IPv6 support * IPv6 support * Ethernet driver JL1101 Co-authored-by: Danii Mirsanov <daniil.mirsanov@openlm.com> * Update install-platformio-esp32.sh * Fix conflicts * Tasmota repos * overlooked `timeout` change to `timeout_ms` * Update toolchains and openocd for ESP-IDF v4.4.4 * Update get.py to support Apple ARM64 * Update package version * Update ESP-IDF libs to v4.4.4 * Fix compilation issue caused by ESP-Insights * Update esptool to v4.4 * Update esptool to v4.5 * Sets correct code for UART baud rate detection Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * General examples updates (espressif#7727) (espressif#196) * Remove inline code comments for the struct description * Renamed ESPNow examples * Changed example from C++ class to C struct * Updated MultiHomedServers * Updated BT Serial examples * Added short overview of exaples - missing Enterprise * Added draft of Enterprise header note * Fixed note in README * Fixed compilation error * Changed FunctionalInterrupt example * Fixes * Returned FunctionalInterrupts to original state + added modified version as new example Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> --------- Co-authored-by: me-no-dev <hristo@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com>
* Tasmota changes * Tasmota 2.0.6 with IPv6 support * IPv6 support * Ethernet driver JL1101 Co-authored-by: Danii Mirsanov <daniil.mirsanov@openlm.com> * Update install-platformio-esp32.sh * Fix conflicts * Tasmota repos * overlooked `timeout` change to `timeout_ms` * Sets correct code for UART baud rate detection Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * General examples updates (espressif#7727) (#196) * Remove inline code comments for the struct description * Renamed ESPNow examples * Changed example from C++ class to C struct * Updated MultiHomedServers * Updated BT Serial examples * Added short overview of exaples - missing Enterprise * Added draft of Enterprise header note * Fixed note in README * Fixed compilation error * Changed FunctionalInterrupt example * Fixes * Returned FunctionalInterrupts to original state + added modified version as new example Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com>
* Update toolchains and openocd for ESP-IDF v4.4.4 * Update get.py to support Apple ARM64 * Update package version * Update ESP-IDF libs to v4.4.4 * Fix compilation issue caused by ESP-Insights * Update esptool to v4.4 * Update esptool to v4.5 * Update package_esp32_index.template.json * Tasmota changes for core 2.0.7 * Tasmota changes * Tasmota 2.0.6 with IPv6 support * IPv6 support * Ethernet driver JL1101 Co-authored-by: Danii Mirsanov <daniil.mirsanov@openlm.com> * Update install-platformio-esp32.sh * Fix conflicts * Tasmota repos * overlooked `timeout` change to `timeout_ms` * Sets correct code for UART baud rate detection Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * General examples updates (espressif#7727) (#196) * Remove inline code comments for the struct description * Renamed ESPNow examples * Changed example from C++ class to C struct * Updated MultiHomedServers * Updated BT Serial examples * Added short overview of exaples - missing Enterprise * Added draft of Enterprise header note * Fixed note in README * Fixed compilation error * Changed FunctionalInterrupt example * Fixes * Returned FunctionalInterrupts to original state + added modified version as new example Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> * Fix change * remove duplicate fix * Delete README.md * Create README.md * Fix erratic problem when sending IPv6 UDP packet * Update WiFiGeneric.cpp --------- Co-authored-by: me-no-dev <hristo@espressif.com> Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
* Tasmota changes for core 2.0.7 * Tasmota changes * Tasmota 2.0.6 with IPv6 support * IPv6 support * Ethernet driver JL1101 Co-authored-by: Danii Mirsanov <daniil.mirsanov@openlm.com> * Update install-platformio-esp32.sh * Fix conflicts * Tasmota repos * overlooked `timeout` change to `timeout_ms` * Sets correct code for UART baud rate detection Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * General examples updates (espressif#7727) (#196) * Remove inline code comments for the struct description * Renamed ESPNow examples * Changed example from C++ class to C struct * Updated MultiHomedServers * Updated BT Serial examples * Added short overview of exaples - missing Enterprise * Added draft of Enterprise header note * Fixed note in README * Fixed compilation error * Changed FunctionalInterrupt example * Fixes * Returned FunctionalInterrupts to original state + added modified version as new example Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> * Fix change * remove duplicate fix * Delete README.md * Create README.md * Delete README.md * Create README.md * Tasmota * Tasmota changes for core 2.0.7 * IPv6 support * Ethernet driver JL1101 * Fix erratic problem when sending IPv6 UDP packet * Fix erratic problem when sending IPv6 UDP packet * Update package_esp32_index.template.json * Update WiFiGeneric.cpp * Update WiFiGeneric.cpp (#211) --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
* Update toolchains and openocd for ESP-IDF v4.4.4 * Update get.py to support Apple ARM64 * Update package version * Update ESP-IDF libs to v4.4.4 * Fix compilation issue caused by ESP-Insights * Update esptool to v4.4 * Update esptool to v4.5 * Update package_esp32_index.template.json * Tasmota changes for core 2.0.7 * Tasmota changes * Tasmota 2.0.6 with IPv6 support * IPv6 support * Ethernet driver JL1101 Co-authored-by: Danii Mirsanov <daniil.mirsanov@openlm.com> * Update install-platformio-esp32.sh * Fix conflicts * Tasmota repos * overlooked `timeout` change to `timeout_ms` * Sets correct code for UART baud rate detection Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * General examples updates (espressif#7727) (#196) * Remove inline code comments for the struct description * Renamed ESPNow examples * Changed example from C++ class to C struct * Updated MultiHomedServers * Updated BT Serial examples * Added short overview of exaples - missing Enterprise * Added draft of Enterprise header note * Fixed note in README * Fixed compilation error * Changed FunctionalInterrupt example * Fixes * Returned FunctionalInterrupts to original state + added modified version as new example Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> * Fix change * remove duplicate fix * Delete README.md * Create README.md * Fix erratic problem when sending IPv6 UDP packet * Update WiFiGeneric.cpp --------- Co-authored-by: me-no-dev <hristo@espressif.com> Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
* Tasmota release/ * Tasmota changes for core 2.0.7 * Tasmota changes * Tasmota 2.0.6 with IPv6 support * IPv6 support * Ethernet driver JL1101 Co-authored-by: Danii Mirsanov <daniil.mirsanov@openlm.com> * Update install-platformio-esp32.sh * Fix conflicts * Tasmota repos * overlooked `timeout` change to `timeout_ms` * Sets correct code for UART baud rate detection Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * General examples updates (espressif#7727) (#196) * Remove inline code comments for the struct description * Renamed ESPNow examples * Changed example from C++ class to C struct * Updated MultiHomedServers * Updated BT Serial examples * Added short overview of exaples - missing Enterprise * Added draft of Enterprise header note * Fixed note in README * Fixed compilation error * Changed FunctionalInterrupt example * Fixes * Returned FunctionalInterrupts to original state + added modified version as new example Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> * Fix change * remove duplicate fix * Delete README.md * Create README.md * Delete README.md * Create README.md * Tasmota * Tasmota changes for core 2.0.7 * IPv6 support * Ethernet driver JL1101 * Fix erratic problem when sending IPv6 UDP packet * Fix erratic problem when sending IPv6 UDP packet * Update package_esp32_index.template.json * Update WiFiGeneric.cpp * Update WiFiGeneric.cpp (#211) --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com> * `tv.tv_usec = (_timeout % 1000) * 1000;` align with upstream * Update package_esp32_index.template.json * allows setting buffer size after or before begin() (#242) Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * 2.0.12 --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
This PR contains improvements of more examples which have been investigated in issue #7659.
Updated examples: (to be added)